using System;
using System.Collections.Generic;
using System.Text;
using System.ServiceModel;
using Sinacor.Infra.Service.Security.Services;
using Sinacor.Servico.Infra.Licensing.Service.ServiceContract;
using Sinacor.Servico.Infra.Licensing.Service.DataContract;
using Sinacor.Servico.Infra.Licensing.BusinessLogic;
using Sinacor.Servico.Infra.Licensing.BusinessEntity;
using Sinacor.Servico.Infra.Licensing.Service.ServiceImplementation.Translator;

namespace Sinacor.Servico.Infra.Licensing.Service.ServiceImplementation
{

    /// <summary>
    /// Classe de implementacao de contrato de servico Licensing
    /// </summary>
    [SinacorServiceBehavior]
    public class Licensing : Sinacor.Servico.Infra.Licensing.Service.ServiceContract.ILicensing
    {

        #region Construtor
        public Licensing()
        {

        }
        #endregion


        #region ILicensing Members

        public Sinacor.Servico.Infra.Licensing.Service.DataContract.LicenseDC GetLincensing()
        {
            // Data contract
            LicenseDC ldc = null;

            // Business Entity
            LicenseBE lbe = null;

            // Business Logic
            LicenseBL lbl = new LicenseBL();
            
            // Tradutor de Business Entity para Data Contract
            LicenseBEToLicenseDC lbetodc = new LicenseBEToLicenseDC(); ;

            // Preenche a Business Entity a partir do retorno da Business Logic
            lbe = lbl.GetLicense();

            // Traduz a Business Entity para Data Contract
            ldc = lbetodc.Translate(lbe);

            // Retorna o Data Contract
            return ldc;
        }

        #endregion
    }
}
